library(ISLR)
summary(Carseats)
attach(Carseats)
lm.fit = lm(Sales~Price+Urban+US)
summary(lm.fit)
#10c.
#Sales = 13.04 + -0.05 Price + -0.02 UrbanYes + 1.20 USYes
#10d.
#10e.
lm.fit2 = lm(Sales ~ Price + US)
summary(lm.fit2)
#10f.
#10g.
confint(lm.fit2)
#10h.
plot(predict(lm.fit2), rstudent(lm.fit2))
par(mfrow=c(2,2))
plot(lm.fit2)

